{
  "properties" : { },
  "id" : "d13eddeab7754f46aae04cd07c4428fa",
  "script" : null,
  "groupId" : "fab72dbfa20d4363af209197603c2b6e",
  "name" : "计划结果",
  "createTime" : 1727070983210,
  "updateTime" : 1726282109671,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "result",
  "method" : "GET",
  "parameters" : [ {
    "name" : "metric",
    "value" : "linkUpDown",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }, {
    "name" : "current",
    "value" : "0",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }, {
    "name" : "size",
    "value" : "11",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 500,\n    \"success\": false,\n    \"data\": {},\n    \"msg\": \"系统维护中，请稍后重试。\"\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }
}
================================
import lombok.experimental.var

var sql = """

    select dev.device_name,dev.ip,dict.dict_value,count(*) alarmnum,max(info.alarm_time) as alarm_time
    from alarm_info info
    left join ndmp_device dev on dev.id = info.alarm_target
    left join alarm_rule ru on ru.id = info.alarm_rule_id
	left join alarm_metric met on met.id = ru.rule_metric_id
    left join blade_dict dict on dict.dict_key = dev.device_type
    where info.is_recovery = 0 and met.code = #{metric} and dict.code = 'deviceType'
    group by alarm_target

"""

return db.page(sql) 
